<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> 
<mapper namespace="com.netease.dao.UserDao">
    <select id="countAll" resultType="int">
        select count(*) c from user;
    </select>
    
    <select id="getNameById" resultType="String">
    	select userName from user where userId=#{id};
    </select>
 
	<select id="getAll" resultType="com.netease.dao.User">
    	select * from user;
    </select>
    
    <insert id="add" parameterType="com.netease.dao.User">
		insert into user(userName, userAge) values(#{userName},#{userAge}); 
 	</insert>
</mapper>